using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SMS.OnLine.Security;
using SMS.OnLine.Site;

public partial class Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        string user_id = Login1.UserName.Trim();
        string password = Login1.Password;
        
        Passport passport = Passport.Login(user_id, password);
        //if (passport.Identity.IsAuthenticated)
        //{
            
        //    foreach (string role in Roles.GetAllRoles())
        //    {
        //        //Roles.DeleteRole(role);
        //    }
        System.Web.Security.FormsAuthentication.SetAuthCookie(user_id, true);
        Session.Add("Passport", passport);
        Response.Redirect("~/Default.aspx", true);
       
        
        //}

    }
}
